Chooses which font every draw_text call uses from here on, until changed again. Optional, not required before your first draw_text call - it already draws with the engine’s own built-in fallback font until this is called for the first time.
font_set(f)| Name | Type |
|---|---|
f | font |
Nothing.
Chooses which font every draw_text call uses, from here until it is changed again - ambient state, not an argument you pass to each drawing call. A project with more than one font (a HUD face and a dialogue face, say) calls this to switch between them before each block of text that needs the other one.
Optional, not required: before this is ever called, draw_text draws with the project's default font, font_default. A build adds it to any project that draws text, as an ordinary font you can open in the Paint tab. A project that only ever wants one plain face does not need to call this at all.
A game can draw words in 4 different fonts at once. You can change that in Project Settings, under Engine limits, as "Fonts draw_text can use" (from 1 to 16; each font costs about 90 bytes of memory). Choosing the same font from many objects counts once: it is the font that counts, not which object chose it. A fifth font would draw nothing, so a development build stops and says so, and the Problems list warns you when your code picks more fonts than there is room for.
font_set(font_doc_main);Selects a font once - commonly done in a room's own creation code or an object's Create, so every later draw_text call in that room already has the right font active without repeating this call everywhere.
The Game Boy Color keeps the colors of the words in a few shared sets, so two fonts painted in different colors do not always keep their own on the same screen. A game gets up to 3 sets of text colors of its own: each different set of colors among the fonts your project uses is kept apart, and words in those fonts show exactly the colors you painted, even when they are on screen together. The pictures of a room then have one set of colors fewer to share for each one (the Budgets panel shows the number your game has).
A fourth set of colors has no room of its own, and neither does a font that no object, room or script of your project names. Those words share a set of colors, and they take the colors of the font drawn last: when a line in one of them is drawn, every other line sharing that set changes to the same colors at once.
To keep every font's colors, use at most 3 different color sets for text and choose each font by name with font_set. Fonts painted with the same colors cost nothing extra.
The original Game Boy has no colors to share, so none of this applies there: words show the shades of the screen.